package com.project.nimsen.web.sys;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.shiro.util.CollectionUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.project.jdbc.web.BaseMVCAction;
import com.project.nimsen.common.web.LoginUser;
import com.project.nimsen.service.ISUnitsService;
@Controller
@RequestMapping(value ="/sys/units")
public class SUnitsControl extends BaseMVCAction {
	@Resource
	ISUnitsService sunitService;
	//得到除自己以外的所有信息
	@RequestMapping(value="unitsExtMy")
	@ResponseBody
	public List<Map<String, Object>> unitsExtMy(){
		LoginUser loginUser = LoginUser.getCurr();
		try {
			List<Map<String, Object>> list = sunitService.findExitId(loginUser.getUnitid());
			if(CollectionUtils.isEmpty(list))
				return null;
			return list;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
}
